package com.zcy.gift.controller;

import com.zcy.gift.doc.GiftDoc;
import com.zcy.gift.query.GiftQuery;
import com.zcy.gift.service.IGiftSearchService;
import com.zcy.gift.util.AjaxResult;
import com.zcy.gift.util.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * </p>
 *
 * @author lucker
 * @date 2024/2/18 0:42
 */
@RestController
@RequestMapping("/gift/search")
public class GiftSearchController {

    @Autowired
    private IGiftSearchService giftSearchService;

    @RequestMapping("/query")
    public AjaxResult search(@RequestBody GiftQuery giftQuery) {
        PageList<GiftDoc> pageList = giftSearchService.search(giftQuery);
        return AjaxResult.me().setResultObj(pageList);
    }
}
